<?php

class Zend_View_Helper_Path extends Zend_View_Helper_Abstract {

    protected $options = array(
        'text' => '-',
        'class' => '',
        'items' => array(
        )
    );

    public function path($options = array()) {

        $options = array_merge($this->options, $options);
        $r = '<ul class="path">';
        $i = 0;
        foreach ($options['items'] as $item) {

            $r .= '<li class="' . ($i == count($options['items']) - 1 ? 'last ' : '') . 'fl">';
            $r .= ($i == count($options['items']) - 1 ? '<span>' : '<a href="' . $item['link'] . '">');
            $r .= $item['label'] . '' . ($i == count($options['items']) - 1 ? '</span>' : '</a>');
            $r .= '</li>';

            $r .= $i == count($options['items']) - 1 ? '' : '<li class="fl"> &gt; </li>';

            $i+=1;
        }
        $r .= '<li class="cls"></li></ul>';
        return $r;
    }

}